angular.module('app-router', ['ui.router'])

.config ($stateProvider, $urlRouterProvider) ->
    $stateProvider
    .state('tab',
        url: '/tab/wechat'
        template: '<ion-nav-view></ion-nav-view>'
        abstract: true
    )

    .state('tab.myself',
        url: '/myself'
        templateUrl: 'templates/pages/tab-myself/tab-myself.html'
        controller: 'TabMyselfCtrl'
        cache:false
    )

    .state('tab.home',
        url: '/home'
        templateUrl: 'templates/pages/tab-home/tab-home.html'
        controller: 'TabHomeCtrl'
        cache:false
    )

    .state('tab.order-list',
        url: '/tab-order-list'
        templateUrl: 'templates/pages/tab-order-list/tab-order-list.html'
        controller: "TabOrderListCtrl"
        cache:false
    )

    .state('tab.yuyue',
        url: '/tab-yuyue'
        templateUrl: 'templates/pages/tab-yuyue/tab-yuyue.html'
        controller: "TabYuyueCtrl"
        cache:false
    )

    .state('tab.orderDetail',
        url: '/tab-orderDetail/{id}'
        templateUrl: 'templates/pages/tab-orderDetail/tab-orderDetail.html'
        controller: "OrderDetailCtrl"
        cache:false
        params:
            id: 0
    )

    .state('tab.myinfo',
        url: '/tab-myinfo'
        templateUrl: 'templates/pages/tab-myinfo/tab-myinfo.html'
        controller: "TabMyinfoCtrl"
        cache:false
    )

    .state('tab.visinfo',
        url: '/tab-visinfo'
        templateUrl: 'templates/pages/tab-visinfo/tab-visinfo.html'
        controller: "TabVisinfoCtrl"
        cache:false
    )

    .state('tab.editinfo',
        url: '/tab-editinfo'
        templateUrl: 'templates/pages/tab-editinfo/tab-editinfo.html'
        controller: "EditinfoCtrl"
        cache:false
    )

    .state('tab.pay',
        url: '/tab-pay/{id}'
        templateUrl: 'templates/pages/tab-pay/tab-pay.html'
        controller: "TabPayCtrl"
        cache:false
        params:
            id: 0
    )
    $urlRouterProvider.otherwise '/tab/wechat/home'
